package com.example.app03.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.example.app03.bean.Artical;

public interface ArticalDao {
	@Insert("insert into cms_article(id,title,content,publish_time,read_times,status,thump_up,cover,project_id,author_id,category_id,compony_id) values(null,#{title},#{content},#{publish_time},#{read_times},#{status},#{thump_up},#{cover},#{project_id},#{author_id},#{category_id},#{compony_id})")
	void save(Artical artical);
	//
	@Select("select * from cms_article")
	List<Artical> selectAll();
	
	
	@Select("select * from cms_article where id = #{id}")
	Artical selectById(long id);
	
	@Delete("delete from cms_article where id = #{id}")
	void deleteById(long id);
}
